<!-- eslint-disable vue/multi-word-component-names -->
<template>
  <van-floating-bubble
        axis="xy"
        v-if="!okks"
        icon="circle"
        magnetic="x"
        v-model:offset="offset"
        style="background-color: rgba(30, 28, 28,.5);"
        @offset-change="onOffsetChange"
        @click="tar"
      />
  </template>
  
  <script setup>
    import {computed,ref} from 'vue'
    import { useRoute,useRouter } from 'vue-router' // 从Vue Router库中导入useRoute和useRouter函数
    
    const router = useRouter()  // 使用useRouter函数创建router对象
    const okks = computed(() => useRoute()?.matched[0]?.path === '/tabBarView' || useRoute()?.matched[0]?.path ==='/')
    const onOffsetChange = (offset) => {
      console.log(`x: ${offset.x.toFixed(0)}, y: ${offset.y.toFixed(0)}`);
    };
    const tar = () =>{
    router.push('/home')  // 跳转到'/StudentProfile'路径
    }
    const offset = ref({ x: 313, y: 567 });
  </script>
  

  